<%@ page language="java" contentType="text/html; charset=EUC-KR"
	pageEncoding="EUC-KR"%>
<%@ page import="java.io.*"%>
<%@ page import="org.apache.solr.client.solrj.*"%>
<%@ page import="org.apache.solr.client.solrj.impl.*"%>
<%@ page import="org.apache.solr.client.solrj.response.QueryResponse"%>
<%@ page import="org.apache.solr.common.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	request.setCharacterEncoding("UTF-8");
	String search = request.getParameter("search");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body id="page-top" class="index">
	<%
		try {
			HttpSolrServer solr = new HttpSolrServer(
					"http://192.168.0.23:8080/solr/test1");

			SolrQuery query = new SolrQuery();
			query.setQuery("*:*");
			query.setRequestHandler("/select");
			query.setFields( request.getParameter("search"));

			query.setStart(0);
			query.setRows(20);

			QueryResponse rest_ = solr.query(query);
			SolrDocumentList results = rest_.getResults();
			for (int i = 0; i < results.size(); ++i) {
				out.println(results.get(i));
			}
		} catch (Exception exc) {
			exc.printStackTrace();
		}
	%>
</body>
</html>